#include "bsp_usart.h"
#include "FreeRTOS.h"
#include "usart.h"


rp_t rp;

uint8_t data[14];

uint8_t transmit_data=0;
void usart_task(void const * argument)
{

  for(;;)
  {
		data[0] = 0xee       ;
		
		data[1] = rp.roll>>8 ;
		data[2] = rp.roll    ;		
		data[3] = rp.pitch>>8;		
		data[4] = rp.pitch   ;
		data[5] = rp.yaw>>8  ;
		data[6] = rp.yaw     ;
		
		data[7] = rp.x>>8    ;
		data[8] = rp.x       ;		
		data[9] = rp.y>>8    ;		
		data[10] = rp.y      ;
		data[11] = rp.z>>8   ;
		data[12] = rp.z      ;
		
		data[13] = 0xff      ;
		
		
		
		for(uint8_t t=0;t<=13;t++){
	  transmit_data = data[t];
		HAL_UART_Transmit(&huart1 , &transmit_data , 1 , 0xff);
		vTaskDelay(1);
		}
			
		vTaskDelay(1);
  }

}




